﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Noea.Parser;
using System.Collections;
using System.Net;
using System.Diagnostics;

namespace Noea.Parser
{
    public class HTMLDoc : IHTMLDoc
    {
        private string document;
        private string url;

        public HTMLDoc(string url, string document)
        {
            this.url = url;
            this.document = document;

        }

        public object links { get; set; }

        public string Document
        {
            get { return document; }

        }

        // read-only. Returns the URL of the current web-page
        public string URL
        {
            get { return url; }

        }

        // Returns a list of strings containing the urls of all links to pages on the this site.
        // That is: links to web pages outside this are not included
        public IList GetAllLinks()
        {

            return null;
        }





        // returns true if searchString is found in <body>...</body> in this HTML-document
        public bool Contains(string searchString)
        {

            bool isFound = false;
            for (int i = 0; i < searchString.Length; i++)
            {
                if (isFound == true)
                {
                    break;
                }
            }
            return false;
        }


        //	This method migth be the one that talks to the network via a socket connection
        private string GetHTML(string url)
        {	// Dummy implementation:
            return "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\"> <html> <head> <META NAME=\"Generator\" CONTENT=\"Stone's WebWriter 3.5\"> <meta http-equiv=\"Content-Type\" content=\"text/html; iso-8859-1\"><!-- Minus AutoDato --><title>main</title><meta name=\"FORMATTER\" content=\"Microsoft FrontPage 2.0\"></head><frameset rows=\"17%,83%\" cols=\"17%,83%\"><frame src=\"logo.htm\" name=\"Logo\" scrolling=\"no\"><frame src=\"efterudd.htm\" name=\"efterudd\" scrolling=\"no\"><frame src=\"menu.htm\" name=\"menu\" noresize><frame src= \"php3/kursusliste.php3?aktuelle\"  name=\"text\"><noframes><body><p><!--webbot bot=\"PurpleText\"preview=\"The frameset on this page can be edited with the FrontPage Frames Wizard; use the Open or Open With option from the FrontPage Explorer's edit menu. This page must be saved to a web before you can edit it with the Frames Wizard. Browsers that don't support frames will display the contents of this page, without these instructions. Use the Frames Wizard to specify an alternate page for browsers without frames.\" s-viewable=\" \" --> </p> <p>This web page uses frames, but your browser doesn't support them.</p></body></noframes></frameset></html>";

        }

    }

}